
export class ProductDetailsSpec {
    id: number;
    spec_id: number = 0;
    name: string;
    url: string;
    price: number;
    original_price: number;
    maxLoopAmount: number;
    loopAmount: number;
    coupon: number;

    constructor() {
    }

    getFieldTypeMap():  Map<string, string> {
        let fieldTypeMap = new Map<string, string>();
        fieldTypeMap.set('id', 'Integer');
        fieldTypeMap.set('spec_id', 'Integer');
        fieldTypeMap.set('name', 'String');
        fieldTypeMap.set('url', 'String');
        fieldTypeMap.set('price', 'Double');
        fieldTypeMap.set('original_price', 'Double');
        fieldTypeMap.set('maxLoopAmount', 'Integer');
        fieldTypeMap.set('loopAmount', 'Integer');
        fieldTypeMap.set('coupon', 'Double');
        return fieldTypeMap;
    }

    getClassName(): string {
        return 'product_details_spec';
    }

    getPrimaryKeyList(): string[] {
        let primaryKeyList: string[] = [];
        primaryKeyList.push('id');
        return primaryKeyList;
    }

    getIndexList(): string[] {
        let indexList: string[] = [];
        indexList.push('id');
        return indexList;
    }

    getEncryptedFieldList(): string[] {
        let encryptedFieldList: string[] = [];
        return encryptedFieldList;
    }

    setId(id: number): void {
        this.id = id;
    }

    getId(): number  {
        return this.id;
    }

    setSpec_id(spec_id: number): void {
        this.spec_id = spec_id;
    }

    getSpec_id(): number  {
        return this.spec_id;
    }

    setName(name: string): void {
        this.name = name;
    }

    getName(): string  {
        return this.name;
    }

    setUrl(url: string): void {
        this.url = url;
    }

    getUrl(): string  {
        return this.url;
    }

    setPrice(price: number): void {
        this.price = price;
    }

    getPrice(): number  {
        return this.price;
    }

    setOriginal_price(original_price: number): void {
        this.original_price = original_price;
    }

    getOriginal_price(): number  {
        return this.original_price;
    }

    setMaxLoopAmount(maxLoopAmount: number): void {
        this.maxLoopAmount = maxLoopAmount;
    }

    getMaxLoopAmount(): number  {
        return this.maxLoopAmount;
    }

    setLoopAmount(loopAmount: number): void {
        this.loopAmount = loopAmount;
    }

    getLoopAmount(): number  {
        return this.loopAmount;
    }

    setCoupon(coupon: number): void {
        this.coupon = coupon;
    }

    getCoupon(): number  {
        return this.coupon;
    }

    static parseFrom(inputObject: any): ProductDetailsSpec {
        let result = new ProductDetailsSpec();
        if (!inputObject) {
            return result;
        }
        if (inputObject.id) {
            result.id = inputObject.id;
        }
        if (inputObject.spec_id) {
            result.spec_id = inputObject.spec_id;
        }
        if (inputObject.name) {
            result.name = inputObject.name;
        }
        if (inputObject.url) {
            result.url = inputObject.url;
        }
        if (inputObject.price) {
            result.price = inputObject.price;
        }
        if (inputObject.original_price) {
            result.original_price = inputObject.original_price;
        }
        if (inputObject.maxLoopAmount) {
            result.maxLoopAmount = inputObject.maxLoopAmount;
        }
        if (inputObject.loopAmount) {
            result.loopAmount = inputObject.loopAmount;
        }
        if (inputObject.coupon) {
            result.coupon = inputObject.coupon;
        }
        return result;
    }
}
